//
//  M1WebViewController.m
//  NewMarryU
//
//  Created by apple on 2018/8/21.
//  Copyright © 2018年 Cedar. All rights reserved.
//

#import "M1CerWebViewController.h"
#import "M1RealNameViewController.h"
@interface M1CerWebViewController ()<UIWebViewDelegate>
@property (nonatomic ,strong) UIWebView *m1_webView;
@end

@implementation M1CerWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"付费";
    _m1_webView = [[UIWebView alloc]init];
    _m1_webView.delegate = self;
    [self.view addSubview:_m1_webView];
    [_m1_webView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_offset(UIEdgeInsetsMake(m1_NAV_HEIGHT, 0, 0, 0));
    }];
    [_m1_webView loadHTMLString:self.m1_jsHtml baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] resourcePath]]];
}
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
    if ([request.URL.absoluteString rangeOfString:@"_return?"].location != NSNotFound) {
        [self.navigationController pushViewController:[M1RealNameViewController new] animated:YES];
    }
    return YES;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
